package com.holly.unit.bpmn.activiti.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.holly.unit.bpmn.activiti.entity.ActEntrance;
import com.holly.unit.bpmn.activiti.pojo.ActEntranceRequest;
import com.holly.unit.bpmn.activiti.pojo.dto.ActEntranceDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Description: 入口管理
 * @Author: holly
 * @Date:   2022-03-21
 * @Version: V1.0
 */
public interface ActEntranceMapper extends BaseMapper<ActEntrance> {

    /**分页详情*/
    ActEntranceDTO getById(@Param("entrance") ActEntranceRequest actEntranceRequest);

    /**查询列表*/
    List<ActEntranceDTO> getEntranceList(@Param("param")ActEntranceRequest actEntranceRequest);

    @Update("update act_z_entrance set category_id = #{categoryId} where process_id = #{processId}")
    int updateCategory(@Param("processId")String id, @Param("categoryId")String categoryId);

    @Update("update act_z_entrance set status = #{status} where process_id = #{processId}")
    int updateStatus(@Param("processId")String id, @Param("status")Integer status);

    /**分页查询*/
    Page<ActEntranceDTO> selectEntranceList(@Param("page")Page<ActEntrance> page, @Param("param")ActEntranceRequest actEntranceRequest);

}
